<template>
	<view>
		<custom-header title="详情" />
		<view class="loading_wrap" v-if="loading == 'loading'">
			<up-loadmore
				:status="loading"
				iconSize="22"
				iconColor="#FF3316"
				loadingIcon='semicircle'
				loadingText=""
				/>
		</view>
		<scroll-view
			:scroll-y="true" 
			scroll-with-animation
			:style="{height:'calc(100vh - '+statusBarHeight+'px)'}"
			class="scroll_content_wrap"
			v-if="detail.listData && detail.listData.length && loading != 'loading'">
				<view class="list_wrap">
					<view class="list" v-for="(item,index) in detail.listData" :key="index">
						<view class="info">
							<div class="label">商品名称</div>
							<div class="value">康乃馨-紫精灵B级</div>
						</view>
						<view class="info">
							<div class="label">商品数量</div>
							<div class="value">2扎(14.00元/扎)</div>
						</view>
						<view class="info">
							<div class="label">下单时间</div>
							<div class="value">2025-04-11  14:25:35</div>
						</view>
						<view class="info">
							<div class="label">商品状态</div>
							<div class="value">
								<text>2025-04-11</text>
								<text class="red">[待送达]</text>
								<text>湖南省</text>
							</div>
						</view>
						<view class="name_price">
							<view class="name">李**</view>
							<view class="price">
								<text>合计</text>
								<text class="red">12.00元</text>
							</view>
						</view>
					</view>
				</view>
		</scroll-view>
	</view>
</template>

<script setup>
	import { ref,computed,onMounted } from 'vue'
	import { onLoad } from '@dcloudio/uni-app'
	import { useStore } from 'vuex';
	const store = useStore()
	
	const loading = ref('loadmore')
	const detail = ref({})
	const loadGetDetail = ()=>{
		loading.value = 'loading'
		setTimeout(()=>{
			loading.value = 'loadmore'
			detail.value = {
				listData:[
					{},{},{},{},{},{}
				]
			}
		},1500)
	}
	
	const statusBarHeight = computed(()=>{
		return store.getters.statusBarHeight
	}) 
	
	
	
	onLoad((option)=>{
		console.log(option)
		loadGetDetail()
	})
</script>

<style lang="scss">
	.list_wrap{
		padding: 20rpx;
		.list{
			padding: 20rpx 25rpx;
			border-radius: 20rpx;
			background: #FFFFFF;
			margin-bottom: 20rpx;
			.info{
				display: flex;
				justify-content: space-between;
				font-size: 24rpx;
				padding-bottom: 25rpx;
				.label{
					color: #999999;
				}
				.value{
					color: #666666;
				}
			}
			.name_price{
				padding-top: 20rpx;
				border-top: 1px solid #F0F0F0;
				display: flex;
				justify-content: space-between;
				font-size: 24rpx;
				font-weight: bold;
				color: #333;
			}
			text.red{
				color: #F5564D;
			}
		}
	}
</style>
